The present invention is related to methods and apparatus of recoloring an object in an image.
A common manipulation of images including both still images and in motion video, is to recolor an object. The process of recoloring an object in an image generally involves selecting a portion of an image to be recolored, and then applying adjustments to the selected portion, either manually or by some function. A significant difficulty in recoloring an object is ensuring that the resultant coloration looks natural.
As used herein, a xe2x80x9ccolor spacexe2x80x9d is a multidimensional mathematical coordinate system within which colors are defined. A xe2x80x9ccolorxe2x80x9d is a single point within a color space. Usually, a color space has three dimensions and a color is therefore defined by a triplet of values. However, color spaces, and hence color representations, sometimes have higher order dimensionality. Moreover, the dimensions of a color space can be non-linear and can be expressed in various units, including angles, magnitudes, etc.
Some popular color spaces are known as xe2x80x9cHSLxe2x80x9d, xe2x80x9cRGBxe2x80x9d, xe2x80x9cCMYKxe2x80x9d and xe2x80x9cYCRCBxe2x80x9d. The names of these color spaces make direct reference to the dimensions in which colors are represented. For example, HSL color space has dimensions of hue (H), luminance (L) and saturation (S); while YCRCB color space has dimensions of luminance (Y) and two dimensions of chrominance (CR and CB). The most common color space in which computers represent source images, RGB, has dimensions of red(R), green(G) and blue(B).
Producers of still pictures and motion video programs use a variety of special effects to produce a final product. A graphics editor performs the task of adding special effects to still pictures and to motion video segments using a graphics workstation.
Recoloring is a special effect that involves changing the color of certain pixels within one or more video image frames. One application of recoloring involves modifying the color of an object to make it more or less noticeable in the video image frame. Another application of recoloring is to repair a damaged portion of the video image frame. A third application of recoloring is to add color to a video image frame to generate the appearance of one or more new objects in the video image frame.
Using one technique to achieve a recolor effect, the graphics editor, using a mouse, graphics tablet or similar input device, manually, or with the aid of object tracing software, circumscribes an area of a video image frame that is to receive the recolor effect using the graphics workstation. Then, the graphics editor changes the color of each pixel within the circumscribed area to a specified destination color. The tracing work, whether manual or aided by software, is painstaking and tedious to do accurately.
Since every pixel within the circumscribed area is changed to the new destination color, the graphics editor must circumscribe the intended recolor area with precision. If the graphics editor does a poor job of circumscribing the area, some pixels that were not intended to be changed may be changed, and some pixels intended to be changed may be left unchanged.
Producing recolor effects using this first conventional technique has some drawbacks. In particular, setting each pixel of an object to be a destination color generally makes the object look flat and two-dimensional rather than three-dimensional which is often preferred. Additionally, it is not practical for a graphics editor to perform this process on motion video footage that may include a sequence of hundreds or even thousands of individual frames. Furthermore, conventional color correction algorithms performed on computers are complex and require substantial computer power.
In a related, conventional technique, each pixel in the region circumscribed by the graphics editor is first converted to HSL color space. The technique then replaces the hue value of each selected pixel with a new value equal to the hue of the destination color. Each pixel is then converted back to the color space in which the pixel was originally represented.
This second technique also gives an unnatural appearing result. The recolored portion of the image does not retain the variations in hue or luminance originally present.
In yet another conventional technique, each pixel in the region circumscribed is first converted to YCRCB color space. The values of CR and CB of each selected pixel are replaced with new values corresponding to those of the destination color. Again, each pixel is then converted back to the color space in which the pixel was originally represented.
This third conventional technique also produces an unnatural result. In this technique, replacing a light color with a dark color, or vice versa, exacerbates the unnatural result. For example, if the color being replaced is light, say yellow, and the color being inserted is dark, say red, the result is likely to be an unexpected and undesired pink.
None of the conventional techniques discussed above produces a natural recoloring result which retains all of the subtlety and character of an original object in a recolored object.
Recoloring an object may be performed by calculating an offset in the hue, saturation and luminance between the source and destination colors. The source image is then adjusted using these offsets to produce the desired color.
Accordingly, in one aspect, a method for adjusting the color of a portion of an image involves receiving an indication of a source color and a target color. A difference between the source color and target color are computed to identify offsets in the values of the color components. Pixels identified in the image as matching the source color are adjusted using these offsets to produce a color adjusted image.
In another aspect, an apparatus for manipulating color of a portion of an image includes a difference calculator for determining offsets in the components of the source color and a target color. A color adjustment module receives indications of the pixels to be modified and modifies the pixels of the selected portion of the image according to the determined offsets to provide a color adjusted image.
In accordance with yet other aspects of the invention, there are recolored images and entertainment products incorporating such recolored images. The recolored images and entertainment products of these aspects involve a method including receiving an indication of a source color and a target color. A difference between the source color and target color are computed to identify offsets in the values of the color components. Pixels identified in the image as matching the source color are adjusted using these offsets to produce a color adjusted image.